<?php

namespace App\Logics;

use App\Models\Admin;
use App\Models\SiteDomain;
use App\Service\Base\Logic;
use Illuminate\Support\Facades\Config;

class DomainLogic extends Logic
{

    // 返回所有的关键词
    public function allKeyword()
    {
        $result = Config::get('app.site_keyword');
        $lists  = [];
        foreach($result as $key => $item){
            $lists[] = ['id' => $key + 1, 'name' => $item];
        }

        return $lists;
    }

    // 获取所有的站点
    public function getAllDomain()
    {
        $domainDb = new SiteDomain();
        $domain   = $domainDb->isCache(true)->getList(['status' => 1], 0, "id ASC");

        return $domain;
    }
}


